package com.erbantou.filemanage.service;

import io.minio.messages.Part;
import org.springframework.web.multipart.MultipartFile;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public interface StorageService {
    void uploadFile(String objectName, MultipartFile file) throws Exception;

    String initMultiPartUpload(String objectName, BufferedInputStream data, int partSize, String contentType) throws Exception;

    long uploadFilePart(String objectName, BufferedInputStream data, String contentType, long objectSize, long uploadedSize, int partCount, int partSize, Part[] parts, int partNumber, String uploadId) throws Exception;

    void completeMultipartUpload(String objectName, Part[] parts, String uploadId) throws Exception;

    List<String> listObjects(String prefix, boolean recursive) throws Exception;

    List<String> listObjects() throws Exception;

    List<String> listObjects(boolean recursive) throws Exception;

    List<String> listObjects(String prefix) throws Exception;

    InputStream getObject(String objectName) throws Exception;

    void removeObject(String objectName) throws Exception;

    void removeObjects(String objectName) throws Exception;

    boolean isObjectExist(String objectName);

    InputStream getObjectAsZipStream(List<String> objectNames, String prefix) throws IOException;
}
